package com.hellobike.haxing.modules.wms.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hellobike.haxing.modules.wms.dto.ExportAsnDto;
import com.hellobike.haxing.modules.wms.entity.AsnHeader;
import com.hellobike.haxing.modules.wms.mapper.AsnHeaderMapper;
import com.hellobike.haxing.modules.wms.service.IAsnHeaderService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description: t_wms_asn_header
 * @Author: haxing-boot
 * @Date:   2020-01-09
 * @Version: V1.0
 */
@Service
public class AsnHeaderServiceImpl extends ServiceImpl<AsnHeaderMapper, AsnHeader> implements IAsnHeaderService {

    @Override
    public List<ExportAsnDto> exportAsn(Long asnId) {
        return baseMapper.exportAsn(asnId);
    }

    @Override
    public AsnHeader getByRefOrderId(Long refOrderId) {
        AsnHeader param = new AsnHeader();
        param.setRefOrderId(refOrderId);
        Wrapper<AsnHeader> wrapper = new QueryWrapper<>(param);
        return baseMapper.selectOne(wrapper);
    }
}
